import { currentShape } from "@/views/paint/modules/data/shapes";

import {
  deleteShapeById,
  moveDown,
  moveToBottom,
  moveToTop,
  moveUp
} from "@/store/events/shape.actions";

const t = translate("公共模块");
/* 组件的菜单 */

export const shapeContextmenu = ref([
  {
    title: t.value?.["置顶"],
    onClick: () => {
      moveToTop(currentShape.value.z);
    }
  },
  {
    title: t.value?.["置底"],
    onClick: () => {
      moveToBottom(currentShape.value.z);
    }
  },
  {
    title: t.value?.["上移一层"],
    onClick: () => {
      moveUp(currentShape.value.z);
    }
  },
  {
    title: t.value?.["下移一层"],
    onClick: () => {
      moveDown(currentShape.value.z);
    }
  },
  {
    title: t.value?.["删除"],
    onClick: () => {
      deleteShapeById(currentShape.value.id);
    }
  }
]);
